package com.example.test.主方法运行测试;

public class jkasjfda {

    public final static int a = 3;
    public final static String b = "6767";

    public static void main(String[] args) {
        System.out.println(a);

        System.out.println(b);
        System.out.println(b.hashCode());
//        b = "阿道夫";// string 是不可更改的常量

        final StringBuilder sb = new StringBuilder("haha");
        //同一对象的hashCode值相同
        System.out.println("sb中的内容是：" + sb);
        System.out.println(sb + "的哈希编码是:" + sb.hashCode());
        sb.append("我变了");
        System.out.println("sb中的内容是：" + sb);
        System.out.println(sb + "的哈希编码是:" + sb.hashCode());
// 两次hashcode一样,被final修饰引用不可变
    }
}
